package com.netease.demo.live;

import android.app.Application;
import android.util.Log;

import com.netease.demo.live.util.ScreenUtil;
import com.netease.demo.live.util.crash.AppCrashHandler;
import com.netease.demo.live.util.log.LogUtil;
import com.netease.demo.live.util.storage.StorageType;
import com.netease.demo.live.util.storage.StorageUtil;

/**
 * Created by hzxuwen on 2016/5/21.
 */
public class LiveApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        // init tools
        AppCrashHandler.getInstance(this);
        StorageUtil.init(this, null);
        ScreenUtil.init(this);
        initLog();
    }

    private void initLog() {
        String path = StorageUtil.getDirectoryByDirType(StorageType.TYPE_LOG);
        LogUtil.init(path, Log.DEBUG);
        LogUtil.i("demo", " demo log path=" + path);
    }
}
